package agendaSystem;

import agendaSystem.Entry;

/**
 * A class for the creation of events based on the day, description and number of agendas.
 * 
 * @invar	The description of each event must be a valid description for an event. 
 * 			| isValidDecription(getDescription)
 * @invar	The day of each event must be a valid day for an event.
 * 			| isValidDay(getDay)
 * 
 * @author	Sabrina Knapen, Axel Vranken
 * @version 1.0 
 * 
 */
public class Event extends Entry {

	/**
	 * Initialize a new Event with a given description, day, agendas.
	 * 
	 * @param	description
	 * 			The description of the new event
	 * @param	day
	 * 			The day of the new event
	 * @param	agendas
	 * 			The agendas that shall contain the new event
	 * @pre		The description must be valid for the new event. 
	 * 			| isValidDescription(description)
	 * @pre		The given day must be a valid day for the event. 
	 * 			| isValidDay(day)
	 * @pre		The given agendas must exist 
	 * 			| for each ag in agendas
	 * 			| 		ag.isTerminated = false
	 * @post	The description of this new event is equal to the given
	 * 			description. 
	 * 			| new.getDescription() == description
	 * @post	The day of this new entry is equal to the given day. 
	 * 			| new.getDay() == day
	 * @post	The agendas of this new event is the same as the
	 *          given agendas.
	 *          | for each ag in agendas
	 *       	| new.getAgenda().contains(ag)
	 * @post	The given agendas have this new event as one of the
	 *         	entries on the given day.
	 *         	| for each ag in agendas
	 *       	| 		ag.getEntriesAt(day).contains(this)
	 * @post    The number of entries for the given agendas on the given day is
	 *          incremented by 1.
	 *          | for each ag in agendas
	 *       	| 		ag.getAllEntries() == ag.getAllEntries() + 1
	 * @effect	The event belongs to an array of agendas.
	 * 			| for each ag in agendas
	 * 			| 		ag.addEntry(this)
	 * @effect	The agendas are added to the list of agendas for this event.
	 * 			| for each ag in agenda
	 * 			| 		this.addAgenda(ag)
	 * @throws	IllegalArgumentException
	 * 			Minimum one agenda must be given.
	 * 			|( agendas.length != 0)
	 */
	public Event(String description, int day, Agenda...agendas) throws IllegalArgumentException {
		super(description,day, agendas);
	}
	
	/**
	 * Checks whether the entry overlaps with the other entry.
	 * 
	 * @param 	other
	 * 		  	The other entry to compare with.
	 * @return	The event never overlaps with other entries.
	 *			| return false
	 */
	@Override
	public boolean overlapsWith(Entry other) {
		return false;	
	}
	
	/**
	 * 
	 * Return the slots attached to the event. The slots are the hours
	 * scheduled for the event.
	 * 
	 * @return	Returns the default boolean array because there are no slots attached to an event.
	 * 			| return new boolean[24]
	 */
	@Override
	public boolean[] getSlots() {
		return new boolean[24];
	}
	
	/**
	 * A method for getting the first slot of a given event.
	 * 	
	 * @return	Returns 1 as first slot.
	 * 			| return 1
	 * 
	 */
	@Override
	public int getFirstSlot() {
		return 1; 
	}
	
	/**
	 * A method for getting the last slot of a given event.	
	 * 
	 * @return	Returns 24 as last slot.
	 * 			| return 24
	 */
	@Override
	public int getLastSlot() {
		return 24;
	}
	
	/**
	 * A method for getting the number of slots of an event.
	 * 
	 * @return	Returns 24 as the number of slots attached to this event.
	 * 			| return 24
	 */
	@Override
	public int getNbSlots() {
		return 24;
	}
	
}
